<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<input type="hidden" name="zh_parsen/fzr_name" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name"/>"/>
<input type="hidden" name="zh_parsen/fzr_mobile" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile"/>"/>
<input type="hidden" name="zh_parsen/fzr_tel" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work"/>"/>
<input type="hidden" name="zh_parsen/fzr_email" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email"/>"/>
<div class="t_bar"><span class="color_red">*</span>项目基本情况</div>
	<table class="t_css" width="100%" border="0" cellpadding="0"
	    cellspacing="1" id="tbl_xmjbqk">
	<col style="width: 25%"/>
	<col style="width: 25%"/>
	<col style="width: 25%"/>
	<col style="width: 25%"/>
		<%--<tr>
			<td align="right">项目类别：</td>
			<td colspan="3">
				<span name="proposal/sub_grant_name"><x:out select="$xmlData/data/proposal/sub_grant_name" /></span>
			</td>
		</tr>--%>
	    <tr>
	        <td align="right">项目名称：</td>
	        <td colspan="3">
	        	<input type='text' name='proposal/zh_title' id='zh_title' style="width: 80%" class="input_css required maxlength:100" maxlength="100" value='<x:out select="$xmlData/data/proposal/zh_title"/>' label="项目名称">
	        </td>
	    </tr>
		<%--<tr>
			<td align="right">申请单位：</td>
			<td colspan="3">
				<span name="organizations/organization/org_name"><x:out select="$xmlData/data/organizations/organization[@submit_org='1']/org_name" /></span>
			</td>
		</tr>--%>

		<%--<tr>
			<td align="right">单位地址：</td>
			<td colspan="3">
				<span name="organizations/organization/address"><x:out select="$xmlData/data/organizations/organization[@submit_org='1']/address" /></span>
			</td>
		</tr>--%>
	    <tr >
	        <td align="right">归口管理单位：</td>
	        <td colspan="3">
	        	<c:set var="recomend_org">{'id':'<x:out select="$xmlData/data/proposal/recomend_org_value" />','name':'<x:out select="$xmlData/data/proposal/recomend_org_name" />'}</c:set>
				<cpt:tree key="recommended_org" cacheable="false" className="hn_iuput_kuang " readonly="true" value="${recomend_org}"  label="归口管理单位"
         			id="recomend_org"  showPattern="all" shieldPattern="0" topCheckbox="false" onClick="initTreeValueExt" />
				<input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value"  class="required"  value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" label="归口管理单位">
				<input type="hidden" name="proposal/recomend_org_name" value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
	        </td>
	    </tr>
		<%--<tr>
			<td align="right">项目负责人：</td>
			<td>
				<span name="proposal/fzr_name"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name"/></span>
			</td>
			<td align="right">电子邮箱：</td>
			<td>
				<span name="proposal/fzr_email"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email"/></span>
			</td>
		</tr>
		<tr>
			<td align="right">手机号码：</td>
			<td>
				<span name="proposal/fzr_mobile"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile"/></span>
			</td>
			<td align="right">联系电话：</td>
			<td>
				<span name="proposal/fzr_tel"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work"/></span>
			</td>
		</tr>--%>
	    <tr>
	    	<td align="right">项目联系人姓名：</td>
	    	<td>
	    		<input  type="text" label="项目联系人姓名" name="proposal/contact_psn_cname" class="input_css required" maxlength="50" value="<x:out select="$xmlData/data/proposal/contact_psn_cname" />">
		    	<span name="proposal/contact_email" style="display: none;"> 
			    	<x:out select="$xmlData/data/organization_persons/organization_person[@psn_type='lianxiren']/contact_email"/>
		    	</span>
		    	<span name="proposal/contact_tel" style="display: none;"> 
			    	<x:out select="$xmlData/data/organization_persons/organization_person[@psn_type='lianxiren']/contact_tel"/>
		    	</span>
	    	</td>
	    	<td align="right">联系人手机：</td>
	    	<td>
	    		<input type="text" label="联系人手机" name="proposal/contact_psn_mobile" class="input_css required mobile" maxlength="11" value="<x:out select="$xmlData/data/proposal/contact_psn_mobile" />" onfocus="InitInput.setNumber(this,11,0,0);">
	    	</td>
	    </tr>
		<tr>
			<td align="right">电子邮箱：</td>
			<td>
				<input name="proposal/contact_psn_email" class="dsPsn required email" label="电子邮箱"
					   value="<x:out select="$xmlData/data/proposal/contact_psn_email" />"/>
			</td>
			<td align="right">通讯地址：</td>
			<td>
				<input name="proposal/contact_psn_address" class="dsPsn required" label="通讯地址" maxlength="100"
					   value="<x:out select="$xmlData/data/proposal/contact_psn_address" />"/>
			</td>
		</tr>
        <c:set var="nature_value">
            <x:out select="$xmlData/data/organizations/organization[@submit_org='1']/nature_value" />
        </c:set>
            <c:if test="${fn:substring(nature_value,0,1) eq 'A'}">
                <tr>
                    <td align="right">单位类型：</td>
                    <td colspan="3">
                            <cpt:checkbox key="enterprise_type" name="enterprise_type" repeatColumn="4" style="border: 0px; padding: 0px; margin: 0px;"></cpt:checkbox>
                        <input type="hidden" name="organization/enterprise_type_value" id="chkOrgTypeId2" class="requiredcb"  label="单位类型" value="<x:out select="$xmlData/data/organization/enterprise_type_value" />"/>
                        <input type="hidden" name="organization/enterprise_type_name" value="<x:out select="$xmlData/data/organization/enterprise_type_name" />"/>
                </tr>
            </c:if>

	</table>
<div class="t_bar"><span class="color_red">*</span>获奖专利情况（限10条）</div>
<table  id="tblpatents" cellpadding="0" class="table01" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
	<thead >
	<tr style="border:1px solid #B7D1E6">
		<th class="TblHead" align="center"  width="30px">选择</th>
		<th class="TblHead" align="center"  width="30px">序号</th>
		<th class="TblHead" align="center"  >专利名称</th>
		<th class="TblHead" align="center"  >专利号</th>
		<th class="TblHead" align="center"  >获奖等级</th>
	</tr>
	</thead>
	<tbody id="tab">
	<tr style="display:none">
		<td>&nbsp;
			<input type="radio" class="radiobutton" name="selpatents" >
		</td>
		<td align="center">&nbsp;
			<span name="patents|patent[0]@seq_no" >[index]</span>
		</td>
		<td align="center">
			<input name="patents|patent[0]|patent_name" class=" required input_text" maxlength="100" label="专利名称" value="">
		</td>
		<td align="center">
			<input name="patents|patent[0]|patent_number" class=" required input_text" maxlength="100" label="专利号" value="">
		</td>
		<td align="center">
			<input name="patents|patent[0]|patent_level" class=" required input_text" maxlength="100" label="获奖等级" value="">
		</td>

	</tr>


	<c:set value="0" var="index" scope="page"/>
	<x:forEach select="$xmlData/data/patents/patent" var="patent">

		<c:choose>
			<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
			<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
		</c:choose>
		<tr >
			<td>&nbsp;
				<input type="radio" class="radiobutton" name="selpatents" >
			</td>
			<td align="center">
				<span   name="patents/patent[${flag}${index}]@seq_no" ><x:out select="$patent/@seq_no"/></span>
			</td>
			<td align="center">&nbsp;
				<input name="patents/patent[${flag}${index}]/patent_name" class="input_text required " maxlength="100" label="专利名称" value="<x:out select="$patent/patent_name"/>"/>
			</td>
			<td align="center">&nbsp;
				<input name="patents/patent[${flag}${index}]/patent_number" class="input_text required " maxlength="100" label="专利号" value="<x:out select="$patent/patent_number"/>"/>
			</td>
			<td align="center">&nbsp;
				<input name="patents/patent[${flag}${index}]/patent_level" class="input_text required " maxlength="100" label="获奖等级" value="<x:out select="$patent/patent_level"/>"/>
			</td>

		</tr>
		<c:set value="${index+1}" var="index" scope="page"/>
	</x:forEach>
	<script type="text/javascript">
		showAllDateTag("tblpatents");
	</script>
	</tbody>
</table>
<table width="98%" align="center">
	<tr ><td>
		<input class="button" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('tblpatents',10,'获奖专利情况最多只能填写10条')){addNewRow('tblpatents');showDateTag('tblpatents');}try{top.resizeFrame();}catch(e){};">
		<input class="button" name="cmdMovePrev" type=button value="上移" onclick="movePrev('tblpatents','selpatents')">
		<input class="button" name="cmdMoveNext" type=button value="下移" onclick="moveNext('tblpatents','selpatents')">
		<input class="button" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('tblpatents','获奖专利情况')">
	</td></tr>
</table>
<script type="text/javascript">
$(function() {
	changeTipsOut();
});
function initTreeValueExt(treeId, treeNode) {
 	if ((treeNode && treeNode.isParent)) {
 		scmWarn("请选择具体的" + $("#" + treeId).attr("label"));
 		$("#" + treeId).val("");
 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val("");
 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId	+ "_value']").val("");
 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val("");
 		return false;
 	}
 	var str = treeNode.name;
 	var obj = treeNode.parentNode;
 	while (obj != null) {
 		str = obj.name + "-" + str;
 		obj = obj.parentNode;
 	}
 	
 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
 }
 
 function changeTipsIn() {
	var str=$("#sub_type").val();
	if(str==""||str=="例：国家重点研究与开发计划纳米科技专项"){
		$("#sub_type").val("");
		$("#sub_type").css('color','black');
	}
}
 function changeTipsOut() {
	 var str=$("#sub_type").val();
	 if(str==""||str=="例：国家重点研究与开发计划纳米科技专项"){
			$("#sub_type").val("例：国家重点研究与开发计划纳米科技专项");
			$("#sub_type").css('color','red');
		}
 }
</script>		
